<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta http-equiv='X-UA-Compatible' content='IE=edge'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script src='../vue.js'></script>
    <style>
        .public {
            width: 100px;
            height: 100px;
        }

        .active {
            background: red;
        }

        .noActive {
            background-color: yellowgreen;
        }

        .red {
            color: red;
        }

        .bold {
            font-weight: bold;
        }

        .italic {
            font-style: italic;
        }
    </style>
</head>

<body>
    <div id='app'>
        <div class="public" :class="isActive?'active':'noActive'"></div>
        <div class="public" :class="fontColorClass">box2</div>
        <div class="public" :class="box3Class">box3</div>
        <div class="public" :class="{red:isRed,bold:isBold,italic:isItalic}">box4</div>
        <div class="public" :class="classArr">box5</div>
    </div>
    <script>
        Vue.config.productionTip = false;
        const vm = new Vue({
            el: '#app',

            data() {
                return {
                    isActive: false,
                    fontColorClass: "red",
                    box3Class: {
                        red: true,
                        bold: true,
                        italic: true
                    },
                    isRed: true,
                    isBold: true,
                    isItalic: true,
                    classArr: ['red', 'italic']
                }
            }
        })
    </script>
</body>

</html>